
if exists(SELECT * FROM sys.objects o WHERE o.[object_id]= OBJECT_ID('V_MemberMessage') AND o.[type]=N'V')
BEGIN
	DROP VIEW V_MemberMessage
END
GO
	CREATE VIEW V_MemberMessage
	AS 
	SELECT 
		A.Guid,A.Title,A.[Content],A.CreateTime,B.IsRead,B.ReceiveMemLoginID,
		B.ReceiveIsDeleted,B.SendMemLoginID,B.SendIsDeleted
	FROM dbo.ShopNum1_AgentMessageInfo A 
	INNER JOIN ShopNum1_AgentMemberMessage B ON A.Guid=B.MessageInfoGuid
	WHERE B.IsRead=0 and B.ReceiveIsDeleted=0
